<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ProcessaExcluirVoluntario
 *
 * @author antonio
 */
class ProcessaExcluirVoluntario extends IAbstractInterface implements IIntfacePagina{
    
    public function __construct($server, $banco, $login, $senha, $parametros = "") {
        parent::__construct($server, $banco, $login, $senha, $parametros);
        $this->gerarPagina();
    }

    public function gerarPagina() {
        
        $con  = new Conexcao($this->server,
                $this->banco,
                $this->login,
                $this->senha);
        
        $voluntarioDao = new VoluntarioDAO($con->conec);
        
        $voluntarioDao->consultarVoluntarioPorCpf($_POST['cpf']);
    
        $horarioVoluntarioDao = new HorarioVoluntarioDAO($con->conec);
        
        $horarioVoluntarioDao->deletarHorarioVoluntario($voluntarioDao->voluntarios[0]->id);
    
        $voluntarioDao->deletarVoluntario($_POST['cpf']);
        
        echo '<script>alert("'.$voluntarioDao->message.'")</script>';
       
        
    }    //put your code here
}

?>
